SHFILEOPSTRUCT (Structures)
Last changed: -202.74.138.1

.
Summary
TODO - a short description

C# Definition:

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]

struct SHFILEOPSTRUCT

{

    public IntPtr hwnd;
    public FO_Func wFunc;
    [MarshalAs(UnmanagedType.LPWStr)]
    public string pFrom;
    [MarshalAs(UnmanagedType.LPWStr)]
    public string pTo;
    public ushort fFlags;
    public bool fAnyOperationsAborted;
    public IntPtr hNameMappings;
    [MarshalAs(UnmanagedType.LPWStr)]
    public string lpszProgressTitle;

}

VB Definition:

Structure SHFILEOPSTRUCT
   Public TODO
End Structure

User-Defined Field Types:

FO_Func

Notes:

I tried to use this to send files to the recycle bin. It failed (Marshal.GetLastWin32Error was 6, invalid handle) and sometimes threw a NullReferenceException. To make it work I did the following;

    public IntPtr pFrom;
    public IntPtr pTo;

In my case I only needed pTo so I just added a null byte to the end and used Marshal.StringToHGlobalUni() to set the value

Documentation